package com._4pd.demo.operator;

import com._4pd.demo.formal.crd.AiOperator;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
import io.javaoperatorsdk.operator.Operator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

public class Main {
    private static final Logger log = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) throws IOException {
        log.info("WebServer Operator starting!");

        KubernetesClient client = new KubernetesClientBuilder().build();
        Operator operator = new Operator(client, o -> o.withStopOnInformerErrorDuringStartup(false));
        operator.register(new AiOperatorReconciler());
        operator.register(new CommonReconciler());
        operator.start();
    }
}
